package com.wkbb.basic.service;

import com.github.pagehelper.PageInfo;
import com.wkbb.basic.model.Student;
import com.wkbb.basic.vo.StudentEditInfoVo;
import com.wkbb.basic.vo.StudentManageEditVo;
import com.wkbb.common.base.BaseService;
import com.wkbb.common.dto.ResultDTO;
import com.wkbb.common.dto.basic.*;
import com.wkbb.common.dto.order.PayUserCommodityInfoDto;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author dengjingyuan
 * @date 2019-07-04 14:37
 */

public interface StudentService extends BaseService<Student> {

    Long insert(StudentInfoDto studentInfoDto, String userName) throws Exception;

    Long insert(StudentManageEditVo studentInfoDto, String userName,Boolean isSendToXmppOrSendToDoor , Boolean isClearAddressBook) throws Exception;

    void update(StudentInfoDto studentInfoDto, String userName) throws Exception;

    /**
     * 更新学生信息
     *
     * @param studentInfoDto 学生信息
     * @param userName       操作人
     * @param isBack         是否后台操作
     * @throws Exception 抛出异常
     */
    ResultDTO update(StudentInfoDto studentInfoDto, String userName, boolean isBack) throws Exception;

    void update(StudentManageEditVo studentManageEditVo, String userName,Boolean flag) throws Exception;

    ResultDTO deleteStudent(List<Long> ids, String deleteBy,Integer type) throws Exception;

    StudentEditInfoVo getStudentInfoById(Long id) throws Exception;

    StudentManageEditVo getStudentInfoWithFamilyListById(Long id) throws Exception;

    PageInfo<StudentInfoDto> getStudentInfoPageList(Map<String, Object> params, Integer pageNo, Integer pageSize) throws Exception;

    /**
     * 根据班级ID获取学生分页列表
     *
     * @param params   参数（学校ID,班级ID）
     * @param pageNo   页码
     * @param pageSize 每页条数
     * @return 学生分页列表
     * @throws Exception 抛出异常
     */
    PageInfo<StudentInfoDto> getStudentInfoPageByClassId(Map<String, Object> params, Integer pageNo, Integer pageSize) throws Exception;

    List<StudentInfoDto> getStudentInfoList(Map<String, Object> params) throws Exception;

    /**
     * 根据班级ID获取学生列表
     *
     * @param params 参数（学校ID,班级ID）
     * @return 学生列表
     * @throws Exception 抛出异常
     */
    List<StudentInfoDto> getStudentInfoListByClassId(Map<String, Object> params) throws Exception;


    List<UserInfoDto> getGuardianInfoList(Long userId) throws Exception;

    StudentInfoDto getStudentInfoByMobile(Map<String, Object> params) ;

    ResultDTO<Map<String,Object>> saveData(UserDto userDto, Long orgId, List<Object[]> data,String flag,Integer currentRow,Boolean isClearAddressBook) throws Exception;

    McStudentInfoDto getByCardNo(Map<String,Object> params) throws Exception;

    StudentInfoDto getStudentInfoByMapParams(Map<String, Object> params);

    List<Map<String, Object>> getStudentStatByGrade(Long orgId);

    List<Map<String, Object>> getStudentStatBySex(Long orgId);

    List<Long> getStudentUserIdByParam(Long orgId,Long gradeId,Long classId,String keyWord);

    PageInfo<PayUserCommodityInfoDto> getUserPackageByParam(List<Long> userIds,Integer pageNo,Integer pageSize);

    List<Object[]> exportStudentInfoExcel(Map<String, Object> params) throws Exception;

    void changeClassForStudent(Long orgId,Long newClassId,Long userId,String operateUser);

    void changeGradeForStudent(Long orgId,Long newGradeId,Long userId,String operateUser);

    Student findByMapParams(Map<String, Object> map);

    StudentInfoDto addStudent(StudentInfoDto studentInfoDto,boolean autoCreate);

    ResultDTO updateStudent(StudentInfoDto studentInfoDto) throws Exception;

    int insertStudentFaceRecognition(StudentFaceRecognition data);

    PageInfo<StudentInfoDto> getStudentPageList(HashMap<String, Object> params, int pageNo, int pageSize);

    StudentDetail getStudentDetails(Long id);

    List<Student> findListByMapParams(Map<String, Object> map);
}
